//
//  YSTopicItemFrame.m
//  Yueshi
//
//  Created by yueshi－mac1 on 15/12/8.
//  Copyright © 2015年 悦食中国. All rights reserved.
//

#import "YSTopicItemFrame.h"

@implementation YSTopicItemFrame
- (void)setReviews:(YSReviews *)reviews{
    _reviews = reviews;
    
    //name
    CGSize nameSize = [reviews.postName sizeWithFont:SYS_FONT(kNameFont) constrainedToSize:CGSizeMake(SCREENW - YSPublicXInset *2, MAXFLOAT)];
    _nameFrame = CGRectMake(YSPublicXInset, YSPublicXInset, nameSize.width, nameSize.height);
    
    //image
    CGFloat imageWidth = SCREENW - YSPublicXInset *2;
    _imageFrame = CGRectMake(YSPublicXInset, CGRectGetMaxY(_nameFrame) +5, imageWidth, imageWidth * 500/710);
    
    //tool
    UIImage *icon = [UIImage imageNamed:@"icon_wechat"];
    _toolFrame = CGRectMake(0, CGRectGetMaxY(_imageFrame), SCREENW, icon.size.height + YSPublicXInset *2);
    
    _spliteFrame = CGRectMake(0, CGRectGetMaxY(_toolFrame), SCREENW, YSPublicXInset);
    
    _cellHeight = CGRectGetMaxY(_spliteFrame);
    
    _frame = CGRectMake(0, 0, SCREENW, _cellHeight);

}
@end
